POV-Ray : Newsgroups : povray.general : Macro Initialization? : Re: Macro Initialization? Server Time
10 Aug 2024 13:21:05 EDT (-0400)
  Re: Macro Initialization?  
From: Gail Shaw
Date: 11 Feb 2000 02:26:31
Message: <38a3b9a7@news.povray.org>
>gadget(knobs)
>gadget(knobs,lights,dials)
>gadget(dials,dial_light,dial_needle,dial_range)
>


I had a similar problem writing my wall macro.

What I did was to have as macro parameters only those
fields necessarry. At the beginning of the file with the macro in,
I declare variables for the optional stuff to a default. The
user can then redeclare the variables before calling the macro.

eg

// file macro.inc

#declare Var1=0;

#macro ThisandThat(Vara,Varb,varc)
....
// Use var1 somewhere here
....

#end

Works fine for me, also solves the problem of not being able to
remember which parameter comes first.

Gail
*******************************************************************
* gsh### [at] monotixcoza              * ERROR: COFFEE.COM not found  *
* http://www.rucus.ru.ac.za/~gail/ * Insert cup and press any key *
*******************************************************************
* Definition of an upgrade: Take the old bugs out, put new ones in*
*******************************************************************


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.